from decouple import config  # 如果你使用环境变量

TORTOISE_ORM = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.asyncpg",
            "credentials": {
                "host": config('DB_HOST', default='localhost'),
                "port": config('DB_PORT', default='5432', cast=int),
                "user": config('DB_USER', default='postgres'),
                "password": config('DB_PASSWORD', default='password'),
                "database": config('DB_NAME', default='dbname')
            }
        }
    },
    "apps": {
        "models": {
            "models": ["models.book","models.school", "aerich.models"],
            "default_connection": "default",
        },
    },
    "use_tz": True,  # 如果你想要启用时区支持
    "timezone": "UTC"  # 设置时区
}
